﻿<?php
require_once "config.php";
require_once "OpenApiV3.php";

// 用户的OpenID/OpenKey
$openid = $_POST['openid'];
$openkey = $_POST['openkey'];
$pf = $_POST['pf'];
$pfkey = $_POST['pfkey'];
$ts = time();
$tokentype = $_POST['tokentype'];
$discountid = $_POST['discountid'];

$sdk = new OpenApiV3($appid, $appkey);
$sdk->setServerName($server_name);
		
$params = array(
	'openid' => $openid,
	'openkey' => $openkey,
	'pf' => $pf,
	'pfkey' => $pfkey,
	'ts' => $ts,
	'tokentype' => $tokentype,
	'discountid' => $discountid,
	'zoneid' => 0,
);

$script_name = '/v3/pay/get_token';

$qqRet = $sdk->api($script_name, $params);

echo json_encode($qqRet);

?>
